UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'thLfR7J9DVOFk9Be4f/wT6HuEPdb+RoSSQRPvH9Q+tk=' 
WHERE 
  key_id = 'bfb442a4c7683c0be2fa8d1ef720dae3a40c76656a737b79fd4efaeb5c01c6a7' 
  AND (
    token = 'thLfR7J9DVOFk9Be4f/wT6HuEPdb+RoSSQRPvH9Q+tk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021