UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KEr3XexZmahLWl019pQb/PltaFHlT8+sqvtFqKZb3UE=' 
WHERE 
  key_id = 'ac1795f94aa06b5c0077e25c74f320fb25240cbcc637e2ce24dcdfabc87e6445' 
  AND (
    token = 'KEr3XexZmahLWl019pQb/PltaFHlT8+sqvtFqKZb3UE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022