UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UThdN9mBN4gBWBbX3O9VIzqO7PUr3oeD4vnJ9cQUtbY='
WHERE
key_id = 'ad49ba347a894f35437d0ad00ae416bbdfcd1e9dafb0b7ce8fe97ca834c2ac28'
AND (
token = 'UThdN9mBN4gBWBbX3O9VIzqO7PUr3oeD4vnJ9cQUtbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)