UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jI9Cc3pcmlFNn+sKZcUjJ5DgnOFTmOrKrULeHhDIG9c='
WHERE
key_id = '45a63ce27602d2227665ff5a3c7d728c3dbd51e22652db6cb8aa0e8af7b51af6'
AND (
token = 'jI9Cc3pcmlFNn+sKZcUjJ5DgnOFTmOrKrULeHhDIG9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)