UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tm1MnRZw2tpaVSZ26wFUPmHPuRuq0O6ATbUXx/o5lqY='
WHERE
key_id = '871ac34174172a050341fc3ef8a5ec74dd566862abfb91c465b4f3362f86582b'
AND (
token = 'Tm1MnRZw2tpaVSZ26wFUPmHPuRuq0O6ATbUXx/o5lqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)