UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g2OCIeBZEAiVznK/KxQR1UqQwg8jwlU+27CXrMTKov0=' 
WHERE 
  key_id = '47d3449633fdbb70211632ef7b4dea8b0ece6e68593b491c42aca35271c1d068' 
  AND (
    token = 'g2OCIeBZEAiVznK/KxQR1UqQwg8jwlU+27CXrMTKov0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028