UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ct4CZkIgNfWlwO+IhoyDsLg+TBJwszqI3R214ChLhe8='
WHERE
key_id = '3e34069456e41880ddf908b4109b07f03734c3c241131dcd5c2327c7945f24aa'
AND (
token = 'ct4CZkIgNfWlwO+IhoyDsLg+TBJwszqI3R214ChLhe8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)