UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Tx5vyiNoOerpaesJ1XISoY4nS5h1irNx6UEbzcIYZI='
WHERE
key_id = '0cd2ef5992674cca56c9a8d8ddde01cd86064decdb59dfc67fa9a45ed3b478dd'
AND (
token = '9Tx5vyiNoOerpaesJ1XISoY4nS5h1irNx6UEbzcIYZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)