UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u3wIziuZVvCYnYDdHGED1NL+ATL4cJHmR/NrJU9CQAk='
WHERE
key_id = '31b86d03d7b5ea4fccd509deebdd881a0cb5a96b4422d7e7294d0e54e5426732'
AND (
token = 'u3wIziuZVvCYnYDdHGED1NL+ATL4cJHmR/NrJU9CQAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)