UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u9RNfnQCurAMqzNSuOCCupI5dXlPbELG+N/9LyuzK6Y='
WHERE
key_id = '0ee444e6526e331cd7e5c0fee9c054c092e23eb0f1e8d8cd44e3ffe1a3fe907a'
AND (
token = 'u9RNfnQCurAMqzNSuOCCupI5dXlPbELG+N/9LyuzK6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)