UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MRWxOFrdUNUxEqfe5GfQKdgX33qjekNLccg/GtBGKqs='
WHERE
key_id = '5e6749f704271d57b3dd21c5ea47afff44eabb4eaf884de7207afe23ba00ceb4'
AND (
token = 'MRWxOFrdUNUxEqfe5GfQKdgX33qjekNLccg/GtBGKqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)