UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CHZX9/ZDt+igm7xISzlAdo1KgJGajVQlePYpnIb8odU='
WHERE
key_id = '072381ae201c560c88d6613cc77873b83ace382eb99131e88d2152089f1c32f6'
AND (
token = 'CHZX9/ZDt+igm7xISzlAdo1KgJGajVQlePYpnIb8odU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)