UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4gglJS/UH7QiDhbnDZQecQMB0s9+dZVkh8VKNoQM0FQ='
WHERE
key_id = 'a5bcf48e65a161b4d076defedcf4bb8cfbcf0743df3e7ebe009e4f9c2836953b'
AND (
token = '4gglJS/UH7QiDhbnDZQecQMB0s9+dZVkh8VKNoQM0FQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)