UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's4piTeg2Kgn9zpmeSbVkYd0z1Mdc8CX4zpk6yfaZuAE=' 
WHERE 
  key_id = '9de271efef7cfbbc3b5f16f9d68ec90e4432e6fbb9ea9b58fa138655ff0d13df' 
  AND (
    token = 's4piTeg2Kgn9zpmeSbVkYd0z1Mdc8CX4zpk6yfaZuAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023