UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ADUv6HSAFE7IIJXGX8gu7rUIs3XVpZB1nuRC0nhs7do='
WHERE
key_id = '71708939923d6476bee0db3f395e85a143782ea2b9085d358cfe344dacc1f1fe'
AND (
token = 'ADUv6HSAFE7IIJXGX8gu7rUIs3XVpZB1nuRC0nhs7do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)