UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6chpXP3renNM6FtY0VpYPbvNQwCV5AbXiqriFpGOSEM='
WHERE
key_id = '49209f1aede08e3576a2b7e799afeaa0984db41e610df1d2d18eeffd68662acc'
AND (
token = '6chpXP3renNM6FtY0VpYPbvNQwCV5AbXiqriFpGOSEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)