UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qln+T2ljbo9LVmVP20ICKNuVMJnxn2JRQYaP+irdgw4='
WHERE
key_id = '6341ebe49e7fe06e794ea20c3736bdc25521d9ddf2b9362aec457c1e5a869a90'
AND (
token = 'Qln+T2ljbo9LVmVP20ICKNuVMJnxn2JRQYaP+irdgw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)