UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tIiWnyIQGvBj6wF1ZtMqECOJ8eJF5RV3qwzbUc9JZCE='
WHERE
key_id = '29f36b86b174b5dbb97b81b6d38b9d576b835f509f917fb1256eb2d6acc07ba3'
AND (
token = 'tIiWnyIQGvBj6wF1ZtMqECOJ8eJF5RV3qwzbUc9JZCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)