UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/PjOG/yK0U5QTB1uPnesnT5T+WSb8zPuNuEs1TRXT78=' 
WHERE 
  key_id = '0b7cb77373de542079f0e7960b5e0883dbe9e27ac3e4c7238391e70452e04152' 
  AND (
    token = '/PjOG/yK0U5QTB1uPnesnT5T+WSb8zPuNuEs1TRXT78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022