UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fiPqDpysRiIH4x6FIZ+lqDFc7/EUwjo0cNnng6hohTk=' 
WHERE 
  key_id = '5c98fc91d2c68a7189f7de538e5cdf6d3530e7b1a2038dc0c9c8dc6c0a34387c' 
  AND (
    token = 'fiPqDpysRiIH4x6FIZ+lqDFc7/EUwjo0cNnng6hohTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027