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

Query time 0.00175