UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uqoWuXjQNUz9/5zmjfqIGoOEB1+S6zqzIq5Md5mIdFY='
WHERE
key_id = '8015da1d77443c9c314ab2e501860fca969a2eac594702faa9d38e8978f2d58f'
AND (
token = 'uqoWuXjQNUz9/5zmjfqIGoOEB1+S6zqzIq5Md5mIdFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)