UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tNYx9A/CHycEqpc4hGX6xw2yxFvQzupZsG5tn7G6xgw='
WHERE
key_id = 'edc41003ba3dac9c29b25ecf4c69d453de0d2f7e433fb3fce65314ebb8245ab5'
AND (
token = 'tNYx9A/CHycEqpc4hGX6xw2yxFvQzupZsG5tn7G6xgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)