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