UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zUYEDZnc6tKV3fRJZ5wwLzOn+JKsc2bfnDYlTVqCLn0='
WHERE
key_id = '8625d808aeb3ba5dc496800bab32f4cd5a01c63dba50e3a62661049891961a36'
AND (
token = 'zUYEDZnc6tKV3fRJZ5wwLzOn+JKsc2bfnDYlTVqCLn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)