UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SlYsVIq+cCMpiE/DhEgNvHqkGtj8Cat6ADLdKjdHqMo=' 
WHERE 
  key_id = 'a1f1c8a3868801f57fcb0a3afc55e6d02491b07e0d253a05b1bc32c2b78ab1d2' 
  AND (
    token = 'SlYsVIq+cCMpiE/DhEgNvHqkGtj8Cat6ADLdKjdHqMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032