UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/MbaIHH+ylSl6dim6JYYLeTdCg5+Y03g5rcG45vDpDM='
WHERE
key_id = 'f83a38f304a5be0f9afc7de5223922e87ac34e154799567fdc1048d6cd577f31'
AND (
token = '/MbaIHH+ylSl6dim6JYYLeTdCg5+Y03g5rcG45vDpDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)