UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ak21Mh9ZU44BVsGNjun+YaGHHi3+WoAzYofPbacJTrU='
WHERE
key_id = '09064eaa32d51bc8e3411f0eb2eb0ebc77e608e51074976f911c5ea76bed67cb'
AND (
token = 'ak21Mh9ZU44BVsGNjun+YaGHHi3+WoAzYofPbacJTrU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)