UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yg26JLdPu3/MvsnDP0sBDKWJdUZY93DO4ocvSLdAm20=' 
WHERE 
  key_id = '8de0ef10da66baf185f2b695af3826299d2c4bb2c8acea9e9cab4279cd6c3312' 
  AND (
    token = 'Yg26JLdPu3/MvsnDP0sBDKWJdUZY93DO4ocvSLdAm20=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030