UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TnUO8Ko9+WdbPqWG47BVH0v8eBpjzIH+TIdBB2c6OpA='
WHERE
key_id = '9b15b96d71ee20528dbaf74969ffb3d44c006f66e92a331892446d849a08b584'
AND (
token = 'TnUO8Ko9+WdbPqWG47BVH0v8eBpjzIH+TIdBB2c6OpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)