UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lgyBBMUM7FAykTLYSDnbXAPUcyqxL/bJakPKdoHWiTg=' 
WHERE 
  key_id = '63fd0e76f93dfe437aa1a80ecb62f9979e9395c386d2160ef73d940378794897' 
  AND (
    token = 'lgyBBMUM7FAykTLYSDnbXAPUcyqxL/bJakPKdoHWiTg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036