UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8ply6hV6BXpTfcfGK3UcKUwVJVCOAYwxrAOt3u5rJmY=' 
WHERE 
  key_id = '01f94eeff7ffa0518438488cea69fb08eb75e0965fd8ff360e0760169af80344' 
  AND (
    token = '8ply6hV6BXpTfcfGK3UcKUwVJVCOAYwxrAOt3u5rJmY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036