UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rsqiu3bQYtRfeIeVoXvqCPH8nGPwNs/r/X/8Xb9hICo='
WHERE
key_id = '10f558360b64d2048ebb3e5acf5f01d76055101df75052c2ea970f4dbddfbb73'
AND (
token = 'rsqiu3bQYtRfeIeVoXvqCPH8nGPwNs/r/X/8Xb9hICo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)