UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wi6Xs5Lr96rTUJJ85rI/LohbiZCVnsZWpauLPPJpl5I='
WHERE
key_id = '6a8f6eb328810a6b50fb9aa10291529df54f4587d768f8afd8bf3788772b31c5'
AND (
token = 'wi6Xs5Lr96rTUJJ85rI/LohbiZCVnsZWpauLPPJpl5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)