UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b3g6XarHgHmF7wP07k54RbJQ/wbcgZyPoQ/xeZhLWO8='
WHERE
key_id = '97759f1c1b3df6fba4822eecdc78a743061ecc4a00c5a70f618a947b13e845d9'
AND (
token = 'b3g6XarHgHmF7wP07k54RbJQ/wbcgZyPoQ/xeZhLWO8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)