UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jWvl89+pkusbwXSZGuTpU3KeVZzwY++q7/pGfFOo/8E='
WHERE
key_id = 'f216545ab88ea87df3f37ce6b0937afb7df1e8fb7279ebe788067db921a83f92'
AND (
token = 'jWvl89+pkusbwXSZGuTpU3KeVZzwY++q7/pGfFOo/8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)