UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SDMCXCF/onDU2vhY7V5iVfUTCTcB7vhthjqu0gvqtz0='
WHERE
key_id = '6049ff95d5d70cacfbe151a58fd9f01fa55c5c4822fc4a550951769371fe19a6'
AND (
token = 'SDMCXCF/onDU2vhY7V5iVfUTCTcB7vhthjqu0gvqtz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)