UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd0m2ZmXiof+fplgfxQSkG67FTgR6eR6HnFxagyYPWzk='
WHERE
key_id = '86642701cb81a55b67155d25111b2476417a9f9e8678af6077c140a215b832e0'
AND (
token = 'd0m2ZmXiof+fplgfxQSkG67FTgR6eR6HnFxagyYPWzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)