UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qrNe0glLZ2oZ18Heo6YSuqv3CAwfjWPZ/cJGG7VKGkM='
WHERE
key_id = '9e32cd451430335e3998c04332026ec5bb49c4ea8955dfef6998d7d82a84b556'
AND (
token = 'qrNe0glLZ2oZ18Heo6YSuqv3CAwfjWPZ/cJGG7VKGkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)