UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xLxSTs7k+q/GhYMSGzAXLyh1wMGPw1mLxCd5UZSG1ZE='
WHERE
key_id = '128787873e645940a83b568124060d64f1adef795661c2721d772e0d7c9f3adb'
AND (
token = 'xLxSTs7k+q/GhYMSGzAXLyh1wMGPw1mLxCd5UZSG1ZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)