UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0HzeYoJOVBmq3DDKrGj20KaSFbW+XyKv1uBXQNr4Lck='
WHERE
key_id = 'c261adc81f392e5933023bd6eb7cb786764c0e5a37b51cad56bb7d4d92a09245'
AND (
token = '0HzeYoJOVBmq3DDKrGj20KaSFbW+XyKv1uBXQNr4Lck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)