UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XvcNFYI0O0oQ0zC3TyUsQg66N0CDLIg8RTg7sCmnuNg='
WHERE
key_id = '634269c44c5620b2f47475481c1eb06cd189eb3a51706bdc80e28e9229ea6f25'
AND (
token = 'XvcNFYI0O0oQ0zC3TyUsQg66N0CDLIg8RTg7sCmnuNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)