UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '70vCc0N92vCF+t+Ilzw7yOY/ZmXTTjWsUdbiQQpk8lU='
WHERE
key_id = 'f4af6cadcef6179df7d879ba05af69e44f3e9e42f657fe52034fcf58b5e7182b'
AND (
token = '70vCc0N92vCF+t+Ilzw7yOY/ZmXTTjWsUdbiQQpk8lU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)