UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AlCKUeW8rAeEEDnxpukeMNDC8xLfeblIEhn0afcXjvc='
WHERE
key_id = '611bc2326c8646c802a3e706793b51a4bcdb605bd36d5a37adcc2e2bfb1fddcc'
AND (
token = 'AlCKUeW8rAeEEDnxpukeMNDC8xLfeblIEhn0afcXjvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)