UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mh8I+an0VJ0cBOTSq+wa4wPd3dGLmf+c8LCvYj0qmc0=' 
WHERE 
  key_id = 'f6773b2eb8e6b5193d1cf5dd99ef495aeca4d914f1ec20a5721bc0bf46b186c9' 
  AND (
    token = 'Mh8I+an0VJ0cBOTSq+wa4wPd3dGLmf+c8LCvYj0qmc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022