UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YIus65JL0OARq1cfodDibq0xPEQ9rc3Xo4tMHSRaGK8='
WHERE
key_id = '88acdadfad314375b52e82ff1ab5a685d69383d04ff8793765d5e2c788cc6246'
AND (
token = 'YIus65JL0OARq1cfodDibq0xPEQ9rc3Xo4tMHSRaGK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)