UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd/CmYkEfcOLLy7wrlQNxy8sCOxF1RESziGi7lO4PHIw='
WHERE
key_id = 'b56368efeb5675ee557287fc821a212ab1b5a606a3c0ecc8dc0e1dd38b734209'
AND (
token = 'd/CmYkEfcOLLy7wrlQNxy8sCOxF1RESziGi7lO4PHIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)