UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZyJ0PpT6TTKNbuuz/gduVerkj/QFLl8ywMLoB0VNlVE='
WHERE
key_id = '8622cd8be5b4a0a84ebcd036f51d540b42c239a06277118c1b1d5f5768bbc147'
AND (
token = 'ZyJ0PpT6TTKNbuuz/gduVerkj/QFLl8ywMLoB0VNlVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)