UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/h6gzzWfveHf3qC3BA8SU3guxDruVwQEtRpuxyiXcmw=' 
WHERE 
  key_id = 'ac390605c1ccb5e54c4931dff111407cd9a76c03d4ad80cdcbbbafe5f033ff89' 
  AND (
    token = '/h6gzzWfveHf3qC3BA8SU3guxDruVwQEtRpuxyiXcmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025