UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mfp3KXpwqamRIsmDSheNazXOzSeDdNzwi4y3v24TbVY=' 
WHERE 
  key_id = '8397d86d40164d43417eab51824811a444f4ddd88c65fc46711ea5df9aacea31' 
  AND (
    token = 'Mfp3KXpwqamRIsmDSheNazXOzSeDdNzwi4y3v24TbVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074