UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ISaQZebIPTtuNLoegCSyXYoB/Jy+j/Pyp7dgZi5cmA8='
WHERE
key_id = '98748ce87e40cd8b495f4a1886470ded53e66dfa80aaa67d4411da10ad2af049'
AND (
token = 'ISaQZebIPTtuNLoegCSyXYoB/Jy+j/Pyp7dgZi5cmA8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)