UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LV+kQzE8lNQ+uBL0GQXCsRScIg4LziOton91Y7+MSK4='
WHERE
key_id = 'be86f9d5af7428514a452276e8b50519a316535597912a0dbb22614d6d0e560e'
AND (
token = 'LV+kQzE8lNQ+uBL0GQXCsRScIg4LziOton91Y7+MSK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)