UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NEgLOsWMtA8AUYJsXqyJbO8NUjNhfFO9sdD8UEEcoRU='
WHERE
key_id = '92d5df86edb30be15d3ba7aed46ace89de48796e4afcd3a27e992971281cb295'
AND (
token = 'NEgLOsWMtA8AUYJsXqyJbO8NUjNhfFO9sdD8UEEcoRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)